package com.zjw.remote.app.net;

import android.content.Context;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.grpc.examples.helloworld.GreeterGrpc;

public class NetUtils {

    private static String IP = "";

    private static volatile ManagedChannel channel;

    public static ManagedChannel getManagedChannel() {
        if (channel == null) {
            synchronized (NetUtils.class) {
                if (channel == null) {
                    channel = ManagedChannelBuilder.forAddress(IP, 8080).usePlaintext().build();
                }
            }
        }
        return channel;
    }
}
